<script setup lang="ts" name="app">
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import zhTw from 'element-plus/dist/locale/zh-tw.mjs'
import en from 'element-plus/dist/locale/en.mjs'
import useAutoLockScreen from '@/hooks/autoLockScreen'
import useAutoSignOut from '@/hooks/autoSignOut'
import useSetThemeColor from '@/hooks/setThemeColor'
import { DndProvider } from 'vue3-dnd'
import { HTML5Backend } from 'react-dnd-html5-backend'
import { storeToRefs } from 'pinia'
import { useSystemConfigStoreWithOut } from '@/store/storage/systemConfigStore'
const router = useRouter()
const systemConfigStore = useSystemConfigStoreWithOut()
const { systemConfig, language } = storeToRefs(systemConfigStore)
useAutoLockScreen()
useAutoSignOut(router)
useSetThemeColor()
</script>

<template>
  <DndProvider :backend="HTML5Backend">
    <el-config-provider :locale="language === 'zh' ? zhCn : language === 'en' ? en : zhTw" :size="systemConfig.size === 'default' ? '' : systemConfig.size">
      <lock-screen v-if="systemConfig.isLockScreen"></lock-screen>
      <router-view />
    </el-config-provider>
  </DndProvider>
</template>
